/** 
 * @file	msp_thread.h
 * @brief	
 * 
 *  This file defined some interfaces about thread, including thread-generating, 
 *	thread-terminating, thread synchronization, etc.
 * 
 * @author	hlli
 * @version	1.0
 * @date	2010-05-17
 * 
 * @see		
 * 
 * <b>History:</b><br>
 * <table>
 *  <tr> <th>Version	<th>Date		<th>Author	<th>Notes</tr>
 *  <tr> <td>1.0		<td>2010-05-17	<td>hlli	<td>Create this file</tr>
 * </table>
 * 
 */

#ifndef __MSP_THREAD_H__
#define __MSP_THREAD_H__

#ifdef __cplusplus
extern "C"
{
#endif

#if defined(WIN32) || defined(WINCE)

#define THRD_RET DWORD

#else

#define WINAPI
#define THRD_RET void*
#endif

typedef void* msp_threadhandle;
typedef THRD_RET ( WINAPI *ThreadProc )(void* params);

msp_threadhandle msp_beginthread( ThreadProc proc, void* params );
int msp_closehandle( msp_threadhandle thrd_hd );

void msp_thread_suspend(msp_threadhandle thrd_hd);
void msp_thread_resume(msp_threadhandle thrd_hd);
void msp_thread_wait(msp_threadhandle thrd_hd);

#ifdef __cplusplus
} /*extern "C"*/
#endif

#endif	/* __MSP_THREAD_H__ */